package com.fnzn.entranceGuard.entity.power;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author sxf
 * @since 2019-01-09
 */
@TableName("power_device")
@Data
public class PowerDevice extends Model<PowerDevice> {

    private static final long serialVersionUID = 1L;

    private Integer id;
    @TableField("device_id")
    private String deviceId;
    @TableField("power_id")
    private String powerId;
    @TableField("power_name")
    private String powerName;
    /**
     * 1电表 2温湿度传感器
     */
    @TableField("device_type")
    private String deviceType;
    /**
     * 有功总电量2位小数单位Kwh
     */
    @TableField("total_power")
    private BigDecimal totalPower;
    /**
     * 温度
     */
    @TableField("template")
    private BigDecimal template;
    /**
     * 湿度
     */
    @TableField("humidity")
    private BigDecimal humidity;
    @TableField(exist = false)
    private boolean online;
    @TableField("create_time")
    private Date createTime;
    @TableField("update_time")
    private Date updateTime;
    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "PowerDevice{" +
        ", id=" + id +
        ", deviceId=" + deviceId +
        ", powerId=" + powerId +
        ", powerName=" + powerName +
        "}";
    }
}
